package io;

import java.io.*;

public class PwDemo {
    public static void main(String[] args) throws FileNotFoundException {
        /*
        PrintWriter pw=new PrintWriter("pw.txt");
        pw.println("hello world");
        pw.println("Hello world");
        System.out.println("写出完毕");
        pw.close();
         */
        FileOutputStream fos=new FileOutputStream("pw2.txt");
        OutputStreamWriter osw=new OutputStreamWriter(fos);
        BufferedWriter bw=new BufferedWriter(osw);
        PrintWriter pw=new PrintWriter(bw);
        pw.println("hello world");
        pw.println("hello world");
        System.out.println("写出完毕");
        pw.close();


    }
}

